package com.insurance.enums;

/**
 * 投保单状态枚举类
 */
public enum ProposalStatusEnum {

	SAVE("-1", "待投保"),
	ISINSURE("0", "已投保"),
	ISSUE("1", "已出单"),
	NOISSUE("2", "未出单"),
	CANCEL("3", "已取消"),
	SETTLETMENT("4", "理赔中"),
	ISSETTLETMENT("5", "已理赔"),
	ISBACK("6", "已退保"),
	ERROR("7", "投保失败"),
    DELETE("9", "删除");

    private String code;

    private String message;

    ProposalStatusEnum(String code, String message){
        this.code = code;
        this.message = message;
    }

	public String getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}
	
	public static String getMessage(String code){
		ProposalStatusEnum[] values = ProposalStatusEnum.values();
		for(ProposalStatusEnum proposalStatusEnum : values){
			if(proposalStatusEnum.getCode().equals(code)){
				return proposalStatusEnum.getMessage();
			}
		}
		return "";
	}
    
}
